﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

#region 版本信息
/*********************************************
 * 作者：杜一博
 * 创建日期：2012/8/26 14:32:16
 *********************************************
 * 修改：
 * 修改日期：
 * 修改说明：
 *********************************************/
#endregion

namespace Atomic.User.Entities
{
    /// <summary>
    /// 自定义用户扩展信息
    /// </summary>
    public class UserExtendFieldEntity
    {
        #region 常量
        /// <summary>
        /// DisplayName
        /// </summary>
        public const string DISPLAY_NAME = "DisplayName";
        /// <summary>
        /// Comment
        /// </summary>
        public const string COMMENT = "Comment";
        /// <summary>
        /// Length
        /// </summary>
        public const string LENGTH = "Length";
        /// <summary>
        /// FieldType
        /// </summary>
        public const string FIELD_TYPE = "FieldType";
        #endregion

        /// <summary>
        /// 主键
        /// </summary>
        public virtual int ID
        {
            get;
            set;
        }

        /// <summary>
        /// 关联用户类型ID
        /// </summary>
        public virtual int UserTypeID
        {
            get;
            set;
        }

        /// <summary>
        /// 字段名
        /// </summary>
        [DisplayName("字段名称")]
        [Required]
        [StringLength(50)]
        public virtual string Name
        {
            get;
            set;
        }

        /// <summary>
        /// 字段显示名
        /// </summary>
        [DisplayName("显示名称")]
        [Required]
        [StringLength(20)]
        public virtual string DisplayName
        {
            get;
            set;
        }

        /// <summary>
        /// 字段注释
        /// </summary>
        [DisplayName("备注信息")]
        [StringLength(250)]
        public virtual string Comment
        {
            get;
            set;
        }

        /// <summary>
        /// 数据库字段对应C#的类型（目前支持int，string），不区分大小写
        /// </summary>
        [DisplayName("字段类型")]
        [Required]
        public virtual string FieldType
        {
            get;
            set;
        }

        /// <summary>
        /// 字段长度
        /// </summary>
        [DisplayName("字段长度")]
        [Range(0, 4000)]
        public virtual int Length
        {
            get;
            set;
        }
    }
}
